package com.dankegongyu.lib.common.widget;

import android.content.Context;
import androidx.core.widget.NestedScrollView;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewConfiguration;

/**
 * @author wupuquan
 * @version 1.0
 * @since 2017/12/5 17:58
 */
public class DKNestedScrollView extends NestedScrollView {

    private int mTouchSlop;

    public DKNestedScrollView(Context context) {
        this(context, null);
    }

    public DKNestedScrollView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public DKNestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    @Override
    public void requestChildFocus(View child, View focused) {
        // 解决自动滚动问题 http://jcodecraeer.com/a/anzhuokaifa/androidkaifa/2018/0130/9270.html
    }
}
